<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>我的个人信息</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
		<link rel="stylesheet" href="{:ADDON_PUBLIC_PATH}/css/weuix.min.css" />
		<link rel="stylesheet" type="text/css" href="{:ADDON_PUBLIC_PATH}/css/jquery-weui.min.css"/>
		<link rel="stylesheet" type="text/css" href="{:ADDON_PUBLIC_PATH}/css/iconfont.css"/>
		<link rel="stylesheet" href="{:ADDON_PUBLIC_PATH}/css/header_common.css" />
		<link rel="stylesheet" href="{:ADDON_PUBLIC_PATH}/css/person_edit.css" />
		<link rel="stylesheet" type="text/css" href="{:ADDON_PUBLIC_PATH}/css/guanggao.css"/>
		<style type="text/css">
			#guangtxt{
				top: 40px;
			}
			#clos{
				top: 45px;
				right: 3px;
			}
		</style>
		 <script src="{:ADDON_PUBLIC_PATH}/js/guanggao.js"></script>
		<script type="text/javascript">
		//静态变量
		var SITE_URL = "{:SITE_URL}";
		var IMG_PATH = "__IMG__";
		var STATIC_PATH = "__STATIC__";
		var WX_APPID = "{$jsapiParams.appId}";
		var	WXJS_TIMESTAMP='{$jsapiParams.timestamp}'; 
		var NONCESTR= '{$jsapiParams.nonceStr}'; 
		var SIGNATURE= '{$jsapiParams.signature}';
	</script>
	<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script type="text/javascript" src="minify.php?f=__JS__/prefixfree.min.js,__JS__/m/dialog.js,__JS__/m/flipsnap.min.js,__JS__/m/mobile_module.js&v={:SITE_VERSION}"></script>
	</head>
	<body>
		<div class="weui-header"> 
			<div class="weui-header-left"> 
				<a href="{:U('electron_pic',array('uid'=>$info['id']))}" class="icon icon-12">纸质打印</a>
			</div>
			<h1 class="weui-header-title"></h1>
			<div class="weui-header-right">
<!-- <<<<<<< HEAD
				<if condition="!$info['confirm']"><a href="{:U('updateInfo',array('aid'=>I('aid')))}" class="icon icon-116">修改学号</a></if>
======= -->
				<a href="{:U('updateInfo',array('aid'=>I('aid'),'isteacher'=>$isteacher))}" class="icon icon-116">完善信息</a>

			</div> 
		</div>
		<div id="bgimg">
			
		</div>
		
		
		<div class="box">
			<div class="example">
				<img id="touxiang" src="<if condition="$info['photo_url']">{$info['photo_url']}<else/>{:ADDON_PUBLIC_PATH}/img/touxiang.jpg</if>"/>
			</div>
		
			<div id="posi">
			<if condition="$isteacher">
						<!--教师信息-->
						<div class="weui_cells">
						<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<p>工号</p>
						</div>
						<div class="weui_cell_ft">{$info['card_id']}</div>
					</div>
					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<p>姓名</p>
						</div>
						<div class="weui_cell_ft">{$info['username']}</div>
					</div>

					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<p>手机号码</p>
						</div>
						<div class="weui_cell_ft">{$info['mobile']}</div>
					</div>
					
					
					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<p>部门</p>
						</div>
						<div class="weui_cell_ft">{$info['class']}</div>
					</div>
				</div>
						<else/>
						<!--学生信息-->
						<div class="weui_cells">
					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<p>姓名</p>
						</div>
						<div class="weui_cell_ft">{$info['username']}</div>
					</div>

					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<p>学号</p>
						</div>
						<div class="weui_cell_ft">{$info['no']}</div>
					</div>
					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<p>手机号码</p>
						</div>
						<div class="weui_cell_ft">{$info['mobile']}</div>
					</div>
					
					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<p>身份证</p>
						</div>
						<div class="weui_cell_ft">{$info['card_id']}</div>
					</div>
					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<p>班级</p>
						</div>
						<div class="weui_cell_ft">{$info['class']}</div>
					</div>
				</div>
			</if>
				
				
				<div class="weui_cells">
					<div class="weui_cell">
				<div class="weui_cell_bd weui_cell_primary">
					<p>状态</p>
				</div>
				<div class="weui_cell_ft"><if condition="$info['confirm']"><font color="greed">已完成</font><else/><font color="red">未完成</font></if></div>
				</div>
		    	</div>
				
				<div class="weui_btn_area" style="margin-top: 35px;">
				<if condition="!$info['confirm']">
					 <if condition="$info['photo_url']"><a class="weui_btn weui_btn_primary" href="javascript:void(0)" id="btn">确定</a></if>
				</if>
		            <a class="weui_btn weui_btn_warn" href="javascript:void(0)" id="confirm">拍照</a>
		        </div>
			</div>
			<div class="weui-footer" >
		  <p class="weui-footer__links">
		    <a href="http://h.eqxiu.com/s/04twlh4V" class="weui-footer__link">微生活工作室</a>|  <a href="javascript:void(0)" id="remove">解除绑定</a>
		  </p>
		  <a  href="{:U('term_text_cn')}" class="weui-footer__text" style="border-radius: ;">Copyright © 20016-2017</a>
		</div>
		</div>
		
		
	</body>
	<script src="{:ADDON_PUBLIC_PATH}/js/jquery-3.2.1.min.js"></script>
	<script src="{:ADDON_PUBLIC_PATH}/js/jquery-weui.js" type="text/javascript" charset="utf-8"></script>
	<script src="{:ADDON_PUBLIC_PATH}/js/swiper.js" type="text/javascript" charset="utf-8"></script>
	<script src="{:ADDON_PUBLIC_PATH}/js/zepto.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
		$(function(){
			$('.example img').on('click', function(){
				var src = $('.example img')[0].src;
				var pb1 = $.photoBrowser({
					  items: [
					    src
					  ]
					});
				pb1.open();
				$('.swiper-pagination').children('span').remove();
			});
		});
		$("#btn").click(function(){
			  $.confirm("是否已经完成", "用户信息确认", function() {
		          // location.href = "{:U('photoOk',array('aid'=>I('get.aid'),'uid'=>$info['id']))}";
		         $.ajax({
			    url:"{:U('photoOk',array('aid'=>I('get.aid'),'uid'=>$info['id']))}",
			    type:"get",
			    dataType:"json",
			    data:'',
			    success:function(data){
		            console.log(data);
		            if (data.status == 1) {
		                 $.toast(data.info); 
		                 setTimeout(function(){
		                 	 location.reload();
		                 },1500);
		            } else {
		                 $.toast(data.info, "forbidden");
		            }
			    },
			    error:function(){
			      	$.toast("错误", "forbidden");
			    }
			});
		        }, function() {
		          //取消操作
		        });
		});
			$("#remove").click(function(){
			  $.confirm("解除绑定不得超过三次", "账号解除", function() {
		          // location.href = "{:U('photoOk',array('aid'=>I('get.aid'),'uid'=>$info['id']))}";
		         $.ajax({
			    url:"{:U('removeBand',array('id'=>$info['id']))}",
			    type:"get",
			    dataType:"json",
			    data:'',
			    success:function(data){
		            console.log(data);
		            if (data.status == 1) {
		                 $.toast(data.info); 
		                 setTimeout(function(){
		                 	 location.reload();
		                 },1500);
		            } else {
		                 $.toast(data.info, "forbidden");
		            }
			    },
			    error:function(){
			      	$.toast("错误", "forbidden");
			    }
			});
		        }, function() {
		          //取消操作
		        });
		});
		$("#confirm").click(function(){
			  $.confirm("拍照前请确认个人信息无误哦！", function() {
		          location.href = "{:U('studCode',array('aid'=>$info['aid']))}";
		        }, function() {
		          //取消操作
		        });
		});
	      $.WeiPHP.initWxShare({
	    	    title:"最美档案照——美颜瘦脸",
	    	    imgUrl:"http://wei.gzpyp.edu.cn/Uploads/Picture/2017-09-02/59aa05c299277.png",
	    	    desc:"16,17级可支持在线查看,在线打印,修改背景色+美白美颜+冲印裁剪",
	    	    link: "{:U('index')}",
	    	})
	</script>
</html>